
import TextareaWithParamsV2 from '../../../components/TextareaWithParamsV2'
import { useEffect } from 'react'

const InputCont = ({ info, sourceOptions, editData }) => {
  return (
    <div className="input-cont">
      <div className="mb-2 text-xs text-slate-400">对固定或传入的文本进行加工输出，非字符串类型数据最终会转成字符串类型。</div>
      {info.inputList?.map((input, index) => (
        <div key={index} className="mb-4">
          <TextareaWithParamsV2
            value={input.value || ''}
            onChange={value => {
              const newInputList = [...info.inputList]
              newInputList[index] = { 
                ...input, 
                value,
              }
              editData({ inputList: newInputList })
            }}
            citeOptions={sourceOptions}
          />
        </div>
      ))}
    </div>
  )
}

export default InputCont